<?php
namespace app\components;
use Yii;

/**
 * 验证
 */
class Token extends \yii\base\Widget
{
    private $token = 'hanwenlongyu';

    public function tokenApi($token)
    {
        $to = mb_substr(md5($this->token),5,32);
        if($to === $token){

        }else{
            echo json_encode(['code'=>15,'message'=>'Toekn Verification failed']);exit();
        }
    }
}